negotiator.bidding
Class BidDetails

java.lang.Object
  extended by negotiator.bidding.BidDetails
All Implemented Interfaces:
java.lang.Comparable<BidDetails>

public class BidDetails
extends java.lang.Object
implements java.lang.Comparable<BidDetails>

The BidDetails class is used to store a bid with it's corresponding utility and time it was offered. In this way constant re-computation of the utility values is avoided.

Author:
Tim Baarslag, Alex Dirkzwager, Mark Hendrikx

Constructor Summary
BidDetails(Bid bid, double myUndiscountedUtil)
          Creates a BidDetails-object which stores a bid with it's corresponding utility.
BidDetails(Bid bid, double myUndiscountedUtil, double time)
          Creates a BidDetails-object which stores a bid with it's corresponding utility and the time it was offered.
 
Method Summary
 int compareTo(BidDetails other)
          A comparator for BidDetails which order the bids in reverse natural order of utility.
 boolean equals(java.lang.Object obj)
           
 Bid getBid()
          Returns the bid.
 double getMyUndiscountedUtil()
          Returns the undiscounted utility of the bid.
 double getTime()
          Return the time at which this bid was offered.
 int hashCode()
           
 void setBid(Bid bid)
          Set the bid.
 void setMyUndiscountedUtil(double utility)
          Set the undiscounted utility of the bid.
 void setTime(double time)
          Set the time at which this bid was offered.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BidDetails

public BidDetails(Bid bid,
                  double myUndiscountedUtil)
Creates a BidDetails-object which stores a bid with it's corresponding utility.

Parameters:
bid - of an agent
myUndiscountedUtil - utility of the bid

BidDetails

public BidDetails(Bid bid,
                  double myUndiscountedUtil,
                  double time)
Creates a BidDetails-object which stores a bid with it's corresponding utility and the time it was offered.

Parameters:
bid - of an agent
myUndiscountedUtil - of the bid
time - of offering
Method Detail

getBid

public Bid getBid()
Returns the bid.

Returns:
bid.

setBid

public void setBid(Bid bid)
Set the bid.

Parameters:
bid - to be set in this object.

getMyUndiscountedUtil

public double getMyUndiscountedUtil()
Returns the undiscounted utility of the bid.

Returns:
undiscounted utility of bid.

setMyUndiscountedUtil

public void setMyUndiscountedUtil(double utility)
Set the undiscounted utility of the bid.

Parameters:
utility - of the bid.

getTime

public double getTime()
Return the time at which this bid was offered.

Returns:
time of offering.

setTime

public void setTime(double time)
Set the time at which this bid was offered.

Parameters:
time - of offering.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
string representation of the object (u=UTILITY, t=TIME).

compareTo

public int compareTo(BidDetails other)
A comparator for BidDetails which order the bids in reverse natural order of utility.

Specified by:
compareTo in interface java.lang.Comparable<BidDetails>
Parameters:
other - bid to which this bid is compared.
Returns:
order of this bid relative to the given bid.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
Returns:
hashcode of this object.

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
Parameters:
obj - object to which this object is compared.
Returns:
true if this object is equal to the given object.